<html>
<head>
<style>
body {
font-family: Arial, Verdana, Helvetica, sans-serif;
color: #444;
font-size: 12px;
}
</style>
</head>
<body>
<?php

include("config.php");

$db_www = new DB($server_username,$server_pass,$server_db,$server,$driver);
$db_rdata = new DB($rdata_server_username,$rdata_server_pass,$rdata_server_db,$rdata_server,$rdata_driver);
if ($db_www->isConnected()) {	
	
} else {
	die("Klientų aptarnavimo sistema laikinai neveikia.");
}

if (!$db_rdata->isConnected()) {	
	die("Klientų aptarnavimo sistema laikinai neveikia(rdata).");
}
$link = $_SERVER['SERVER_NAME'].substr($_SERVER['PHP_SELF'],0,-14);


//echo "<A href='http://".$link."index.php' target='_blank'>".$link . "</A><br>";
echo getRobotukasInfo()  . "<br>";
echo getVersionInfo()  . "<br>";
/*
$newinfo = $db_www->returnInfo($debkred_new);	
echo "DEB/KRED dokumentai: ";
if ($newinfo["cnt"] != 0){
	echo "Nauji-";
	echo $newinfo["cnt"];
	echo "</span> ";
}

$newinfo = $db_www->returnInfo($debkred_1P);	
if ($newinfo["cnt"] != 0){
	echo "1P-";
	echo $newinfo["cnt"];
	echo "</span> ";
}
$newinfo = $db_www->returnInfo($debkred_2P);	
if ($newinfo["cnt"] != 0){
	echo "2P-";
	echo $newinfo["cnt"];
	echo "</span> ";
}
$newinfo = $db_www->returnInfo($debkred_3P);	
if ($newinfo["cnt"] != 0){
	echo "3P-";
	echo $newinfo["cnt"];
	echo "</span> ";
}
$newinfo = $db_www->returnInfo($debkred_4P);	
if ($newinfo["cnt"] != 0){
	echo "4P-";
	echo $newinfo["cnt"];
	echo "</span> ";
}
$newinfo = $db_www->returnInfo($debkred_5P);	
if ($newinfo["cnt"] != 0){
	echo "5P-";
	echo $newinfo["cnt"];
	echo "</span> ";
}

$nepinfo = $db_www->returnInfo($debkred_nep);	

if ($nepinfo["cnt"] != 0){
	echo "Nepatvirtina-";
	echo $nepinfo["cnt"];
	echo "</span>";
}

$serija = $db_www->returnInfo($fakt_query);	

$newpard = $db_www->returnInfo(str_replace("<SERIJA>",trim($serija["N23_REIKSME1"]),$pard_new));	
echo "<br>Pardavimai: ";
if ($newpard["cnt"] != 0){
	echo "Nauji-";
	echo $newpard["cnt"];
	echo "</span> ";
}

$newinfo = $db_www->returnInfo(str_replace("<SERIJA>",trim($serija["N23_REIKSME1"]),$pard_1p));	
if ($newinfo["cnt"] != 0){
	echo "1P-";
	echo $newinfo["cnt"];
	echo "</span> ";
}
$newinfo = $db_www->returnInfo(str_replace("<SERIJA>",trim($serija["N23_REIKSME1"]),$pard_2p));	
if ($newinfo["cnt"] != 0){
	echo "2P-";
	echo $newinfo["cnt"];
	echo "</span> ";
}
$newinfo = $db_www->returnInfo(str_replace("<SERIJA>",trim($serija["N23_REIKSME1"]),$pard_3p));	
if ($newinfo["cnt"] != 0){
	echo "3P-";
	echo $newinfo["cnt"];
	echo "</span> ";
}
$newinfo = $db_www->returnInfo(str_replace("<SERIJA>",trim($serija["N23_REIKSME1"]),$pard_4p));	
if ($newinfo["cnt"] != 0){
	echo "4P-";
	echo $newinfo["cnt"];
	echo "</span> ";
}
$newinfo = $db_www->returnInfo(str_replace("<SERIJA>",trim($serija["N23_REIKSME1"]),$pard_5p));	
if ($newinfo["cnt"] != 0){
	echo "5P-";
	echo $newinfo["cnt"];
	echo "</span> ";
}

$neppinfo = $db_www->returnInfo(str_replace("<SERIJA>",trim($serija["N23_REIKSME1"]),$pard_nep));	
if ($neppinfo["cnt"] != 0){
	echo "Nepatvirtina-";
	echo $neppinfo["cnt"];
	echo "</span>";
}
*/
?>
</body>
</html>